home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earkit / news / thor / rexx / edge / previewmsg.edge < prev    next >
Text File  |  1998-05-24  |  1KB  |  54 lines

  1. /* PreviewMsg.edge
  2. ** $VER: PreviewMsg.edge 1.1 (13.01.96)
  3. ** Original script by Troels Walsted Hansen
  4. ** An ARexx script that shows you (in THOR's messagetext listview) 
  5. ** what your message will look like when read by others in THOR.
  6. */
  7.  
  8. options results
  9.  
  10. /* needs Edge and THOR functions */
  11.  
  12. if(substr(address(),1,4) ~= "EDGE") then
  13. do
  14.     say "This script should only be started from inside Edge."
  15.     exit 20
  16. end
  17. else edgeport = address()
  18.  
  19. p = ' ' || address() || ' ' || show('P',,)
  20. thorport = pos(' THOR.',p)
  21.  
  22. if thorport > 0 then thorport = word(substr(p,thorport+1),1)
  23. else
  24. do
  25.     say 'No THOR port found!'
  26.     exit 10
  27. end
  28.  
  29. /* preview msg text in THOR */
  30.  
  31. address 'EDGE'
  32. addressof BW
  33. address value result
  34.  
  35. getenvvar _FE_DosName
  36. old=result
  37.  
  38. getenvvar _FE_Changes
  39. oldch=result
  40.  
  41. SAVEAS 't:PreviewMsg.edge.temp.file'
  42.  
  43. address(thorport)
  44. THORTOFRONT
  45. SHOWTEXT 't:PreviewMsg.edge.temp.file'
  46. if(rc ~= 0) then REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"'
  47.  
  48. /* cleanup and exit */
  49. address
  50. putenvvar _FE_DosName old
  51. putenvvar _FE_Changes oldch
  52. address command 'delete >nil: t:PreviewMsg.edge.temp.file'
  53. exit
  54.